package cn.iocoder.yudao.module.alipay.dal.mysql.sensitivenems;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.alipay.dal.dataobject.sensitivenems.SensitiveNemsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.alipay.controller.admin.sensitivenems.vo.*;

/**
 * 敏感词 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface SensitiveNemsMapper extends BaseMapperX<SensitiveNemsDO> {

    default PageResult<SensitiveNemsDO> selectPage(SensitiveNemsPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SensitiveNemsDO>()
                .eqIfPresent(SensitiveNemsDO::getSensitiveTxt, reqVO.getSensitiveTxt())
                .betweenIfPresent(SensitiveNemsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SensitiveNemsDO::getId));
    }

    default List<SensitiveNemsDO> selectList(SensitiveNemsExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<SensitiveNemsDO>()
                .eqIfPresent(SensitiveNemsDO::getSensitiveTxt, reqVO.getSensitiveTxt())
                .betweenIfPresent(SensitiveNemsDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SensitiveNemsDO::getId));
    }

    default SensitiveNemsDO selectBySensitiveTxt(String SensitiveTxt){
        return selectOne(new LambdaQueryWrapperX<SensitiveNemsDO>()
                .eqIfPresent(SensitiveNemsDO::getSensitiveTxt, SensitiveTxt)
        );
    }

}
